core: Don't default to "master" for show, there is no default branch anymore
authorColin Walters <walters@verbum.org>
Sun, 27 Nov 2011 23:46:11 +0000 (18:46 -0500)
committerColin Walters <walters@verbum.org>
Sun, 27 Nov 2011 23:46:11 +0000 (18:46 -0500)
src/ostree/ot-builtin-show.c

index c524c7a21ed370e9c4be0a1e197e527277f6a0ff..30b1e39297592af5fd0dea71dd805a9d3cd72094 100644 (file)
@@ -182,10 +182,10 @@ ostree_builtin_show (int argc, char **argv, const char *repo_path, GError **erro
   GOptionContext *context;
   gboolean ret = FALSE;
   OstreeRepo *repo = NULL;
-  const char *rev = "master";
+  const char *rev;
   char *resolved_rev = NULL;
 
-  context = g_option_context_new ("- Output a metadata object");
+  context = g_option_context_new ("OBJECT - Output a metadata object");
   g_option_context_add_main_entries (context, options, NULL);
 
   if (!g_option_context_parse (context, &argc, &argv, error))
@@ -195,8 +195,12 @@ ostree_builtin_show (int argc, char **argv, const char *repo_path, GError **erro
   if (!ostree_repo_check (repo, error))
     goto out;
 
-  if (argc > 1)
-    rev = argv[1];
+  if (argc <= 1)
+    {
+      ot_util_usage_error (context, "An object argument is required", error);
+      goto out;
+    }
+  rev = argv[1];
 
   if (print_packfile)
     {